package com.irdstudio.rsp.drools.exception;

/**
 * 错误代码枚举
 */
public enum FireRuleErrorEnum {

    SUCCESS("0000", "执行成功"),
    E_EXEC_EXCEPTION("9992", "执行规则集[%s]异常"),
    E_RULE_COLL_INVALID("9993", "规则集[%s]无效"),
    E_RULE_COLL_QUERY("9994", "查询规则集列表异常"),
    E_DB_EXCEPTION("9995", "数据库交互异常"),
    E_GET_RULE_COMPONENT("9996", "获取规则集组件异常"),
    E_EMPTY_RULE_COLL_ID("9997", "规则集ID为空"),
    E_OTHER("9998", "其它异常信息 %s"),
    E_REQUEST_EMPTY("9999", "请求报文为空");
    private String code;
    private String message;

    private FireRuleErrorEnum(String code, String message){
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage(Object... args) {
        return String.format(this.message, args);
    }

}
